3.792 \(\int \frac {(d \cot (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx\)

Optimal. Leaf size=202 \[ \frac {i n (n+2) (d \cot (e+f x))^{n+4} \, _2F_1\left (1,\frac {n+4}{2};\frac {n+6}{2};-\cot ^2(e+f x)\right )}{4 a^2 d^4 f (n+4)}+\frac {(n+1)^2 (d \cot (e+f x))^{n+3} \, _2F_1\left (1,\frac {n+3}{2};\frac {n+5}{2};-\cot ^2(e+f x)\right )}{4 a^2 d^3 f (n+3)}-\frac {i n (d \cot (e+f x))^{n+3}}{4 a^2 d^3 f (\cot (e+f x)+i)}-\frac {(d \cot (e+f x))^{n+3}}{4 d^3 f (a \cot (e+f x)+i a)^2} \]

[Out]

-1/4*I*n*(d*cot(f*x+e))^(3+n)/a^2/d^3/f/(I+cot(f*x+e))-1/4*(d*cot(f*x+e))^(3+n)/d^3/f/(I*a+a*cot(f*x+e))^2+1/4
*(1+n)^2*(d*cot(f*x+e))^(3+n)*hypergeom([1, 3/2+1/2*n],[5/2+1/2*n],-cot(f*x+e)^2)/a^2/d^3/f/(3+n)+1/4*I*n*(2+n
)*(d*cot(f*x+e))^(4+n)*hypergeom([1, 2+1/2*n],[3+1/2*n],-cot(f*x+e)^2)/a^2/d^4/f/(4+n)

________________________________________________________________________________________

Rubi [A]  time = 0.50, antiderivative size = 202, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 6, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3673, 3559, 3596, 3538, 3476, 364} \[ \frac {(n+1)^2 (d \cot (e+f x))^{n+3} \, _2F_1\left (1,\frac {n+3}{2};\frac {n+5}{2};-\cot ^2(e+f x)\right )}{4 a^2 d^3 f (n+3)}+\frac {i n (n+2) (d \cot (e+f x))^{n+4} \, _2F_1\left (1,\frac {n+4}{2};\frac {n+6}{2};-\cot ^2(e+f x)\right )}{4 a^2 d^4 f (n+4)}-\frac {i n (d \cot (e+f x))^{n+3}}{4 a^2 d^3 f (\cot (e+f x)+i)}-\frac {(d \cot (e+f x))^{n+3}}{4 d^3 f (a \cot (e+f x)+i a)^2} \]

Antiderivative was successfully verified.

[In]

Int[(d*Cot[e + f*x])^n/(a + I*a*Tan[e + f*x])^2,x]

[Out]

((-I/4)*n*(d*Cot[e + f*x])^(3 + n))/(a^2*d^3*f*(I + Cot[e + f*x])) - (d*Cot[e + f*x])^(3 + n)/(4*d^3*f*(I*a +
a*Cot[e + f*x])^2) + ((1 + n)^2*(d*Cot[e + f*x])^(3 + n)*Hypergeometric2F1[1, (3 + n)/2, (5 + n)/2, -Cot[e + f
*x]^2])/(4*a^2*d^3*f*(3 + n)) + ((I/4)*n*(2 + n)*(d*Cot[e + f*x])^(4 + n)*Hypergeometric2F1[1, (4 + n)/2, (6 +
 n)/2, -Cot[e + f*x]^2])/(a^2*d^4*f*(4 + n))

Rule 364

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(a^p*(c*x)^(m + 1)*Hypergeometric2F1[-
p, (m + 1)/n, (m + 1)/n + 1, -((b*x^n)/a)])/(c*(m + 1)), x] /; FreeQ[{a, b, c, m, n, p}, x] &&  !IGtQ[p, 0] &&
 (ILtQ[p, 0] || GtQ[a, 0])

Rule 3476

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[b/d, Subst[Int[x^n/(b^2 + x^2), x], x, b*Tan[c + d
*x]], x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rule 3538

Int[((b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*T
an[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Tan[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x] && NeQ
[c^2 + d^2, 0] &&  !IntegerQ[2*m]

Rule 3559

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim
p[(a*(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1))/(2*f*m*(b*c - a*d)), x] + Dist[1/(2*a*m*(b*c - a*d))
, Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[b*c*m - a*d*(2*m + n + 1) + b*d*(m + n + 1)*Tan
[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2
+ d^2, 0] && LtQ[m, 0] && (IntegerQ[m] || IntegersQ[2*m, 2*n])

Rule 3596

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[((a*A + b*B)*(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1))/(2
*f*m*(b*c - a*d)), x] + Dist[1/(2*a*m*(b*c - a*d)), Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Si
mp[A*(b*c*m - a*d*(2*m + n + 1)) + B*(a*c*m - b*d*(n + 1)) + d*(A*b - a*B)*(m + n + 1)*Tan[e + f*x], x], x], x
] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0] &&  !GtQ[n,
0]

Rule 3673

Int[(cot[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_.))^(p_.), x_Symbol] :> Dist
[d^(n*p), Int[(d*Cot[e + f*x])^(m - n*p)*(b + a*Cot[e + f*x]^n)^p, x], x] /; FreeQ[{a, b, d, e, f, m, n, p}, x
] &&  !IntegerQ[m] && IntegersQ[n, p]

Rubi steps

\begin {align*} \int \frac {(d \cot (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx &=\frac {\int \frac {(d \cot (e+f x))^{2+n}}{(i a+a \cot (e+f x))^2} \, dx}{d^2}\\ &=-\frac {(d \cot (e+f x))^{3+n}}{4 d^3 f (i a+a \cot (e+f x))^2}+\frac {\int \frac {(d \cot (e+f x))^{2+n} (-i a d (1-n)-a d (1+n) \cot (e+f x))}{i a+a \cot (e+f x)} \, dx}{4 a^2 d^3}\\ &=-\frac {i n (d \cot (e+f x))^{3+n}}{4 a^2 d^3 f (i+\cot (e+f x))}-\frac {(d \cot (e+f x))^{3+n}}{4 d^3 f (i a+a \cot (e+f x))^2}+\frac {\int (d \cot (e+f x))^{2+n} \left (-2 a^2 d^2 (1+n)^2-2 i a^2 d^2 n (2+n) \cot (e+f x)\right ) \, dx}{8 a^4 d^4}\\ &=-\frac {i n (d \cot (e+f x))^{3+n}}{4 a^2 d^3 f (i+\cot (e+f x))}-\frac {(d \cot (e+f x))^{3+n}}{4 d^3 f (i a+a \cot (e+f x))^2}-\frac {(1+n)^2 \int (d \cot (e+f x))^{2+n} \, dx}{4 a^2 d^2}-\frac {(i n (2+n)) \int (d \cot (e+f x))^{3+n} \, dx}{4 a^2 d^3}\\ &=-\frac {i n (d \cot (e+f x))^{3+n}}{4 a^2 d^3 f (i+\cot (e+f x))}-\frac {(d \cot (e+f x))^{3+n}}{4 d^3 f (i a+a \cot (e+f x))^2}+\frac {(1+n)^2 \operatorname {Subst}\left (\int \frac {x^{2+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{4 a^2 d f}+\frac {(i n (2+n)) \operatorname {Subst}\left (\int \frac {x^{3+n}}{d^2+x^2} \, dx,x,d \cot (e+f x)\right )}{4 a^2 d^2 f}\\ &=-\frac {i n (d \cot (e+f x))^{3+n}}{4 a^2 d^3 f (i+\cot (e+f x))}-\frac {(d \cot (e+f x))^{3+n}}{4 d^3 f (i a+a \cot (e+f x))^2}+\frac {(1+n)^2 (d \cot (e+f x))^{3+n} \, _2F_1\left (1,\frac {3+n}{2};\frac {5+n}{2};-\cot ^2(e+f x)\right )}{4 a^2 d^3 f (3+n)}+\frac {i n (2+n) (d \cot (e+f x))^{4+n} \, _2F_1\left (1,\frac {4+n}{2};\frac {6+n}{2};-\cot ^2(e+f x)\right )}{4 a^2 d^4 f (4+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [F]  time = 20.01, size = 0, normalized size = 0.00 \[ \int \frac {(d \cot (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[(d*Cot[e + f*x])^n/(a + I*a*Tan[e + f*x])^2,x]

[Out]

Integrate[(d*Cot[e + f*x])^n/(a + I*a*Tan[e + f*x])^2, x]

________________________________________________________________________________________

fricas [F]  time = 1.59, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {\left (\frac {i \, d e^{\left (2 i \, f x + 2 i \, e\right )} + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} - 1}\right )^{n} {\left (e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{4 \, a^{2}}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n/(a+I*a*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

integral(1/4*((I*d*e^(2*I*f*x + 2*I*e) + I*d)/(e^(2*I*f*x + 2*I*e) - 1))^n*(e^(4*I*f*x + 4*I*e) + 2*e^(2*I*f*x
 + 2*I*e) + 1)*e^(-4*I*f*x - 4*I*e)/a^2, x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (d \cot \left (f x + e\right )\right )^{n}}{{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n/(a+I*a*tan(f*x+e))^2,x, algorithm="giac")

[Out]

integrate((d*cot(f*x + e))^n/(I*a*tan(f*x + e) + a)^2, x)

________________________________________________________________________________________

maple [F]  time = 2.21, size = 0, normalized size = 0.00 \[ \int \frac {\left (d \cot \left (f x +e \right )\right )^{n}}{\left (a +i a \tan \left (f x +e \right )\right )^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*cot(f*x+e))^n/(a+I*a*tan(f*x+e))^2,x)

[Out]

int((d*cot(f*x+e))^n/(a+I*a*tan(f*x+e))^2,x)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))^n/(a+I*a*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is undefined.

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {{\left (d\,\mathrm {cot}\left (e+f\,x\right )\right )}^n}{{\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^2} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*cot(e + f*x))^n/(a + a*tan(e + f*x)*1i)^2,x)

[Out]

int((d*cot(e + f*x))^n/(a + a*tan(e + f*x)*1i)^2, x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ - \frac {\int \frac {\left (d \cot {\left (e + f x \right )}\right )^{n}}{\tan ^{2}{\left (e + f x \right )} - 2 i \tan {\left (e + f x \right )} - 1}\, dx}{a^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*cot(f*x+e))**n/(a+I*a*tan(f*x+e))**2,x)

[Out]

-Integral((d*cot(e + f*x))**n/(tan(e + f*x)**2 - 2*I*tan(e + f*x) - 1), x)/a**2

________________________________________________________________________________________